Skip to content

Instantly share code, notes, and snippets.

@stevenhaddox
stevenhaddox / server_certificates_to_pem.md
Last active May 8, 2024 07:13
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

Link full khóa training device driver của embedded Linux ở đây nhé các bạn. Đây là video mình record trong khóa trước, do bị mắc 1 số lỗi về quay phát nên mình sẽ record lại trong khóa hiện tại mình đang dạy.
Bài 1: Kernel module - simple character device.
https://bit.ly/2AzsxrB
Bài 2: Giới thiệu về cơ chế timer trong hệ điều hành.
https://bit.ly/2O2rDpy
Bài 3: Hướng dẫn lập trình điều khiển interrupt trong Linux
kernel. https://bit.ly/2vtenmk
Bài 4: Giới thiệu về cơ chế system call trên Linux.
https://bit.ly/2KkXm32
Bài 5: Giới thiệu về kỹ thuật IPC - Inter Process Communication.
@dersam
dersam / gitkraken.zsh
Last active May 8, 2024 07:12
Open GitKraken using the current repo directory in the cli.
## Open GitKraken using the current repo directory.
## For when you want a prettier view of your current repo,
## but prefer staying in the cli for most things.
## This will break if GitKraken ever removes the -p flag.
## If you're not using OSX, the path is definitely different.
kraken () {
~/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $(pwd)
}
@jamesrochabrun
jamesrochabrun / GenericList.swift
Created July 23, 2020 00:34
GenericList using Swift UI.
// 1
struct GenericList<Element, RowContent: View>: View where Element: Identifiable {
// 2
private let items: [Element]
private let rowContent: (Element) -> RowContent
// 3
public init(_ items: [Element], @ViewBuilder rowContent: @escaping (Element) -> RowContent) {
self.items = items
@noteeeeee
noteeeeee / JetBrainsActivation.md
Last active May 8, 2024 07:07
Webstorm/JetBrains products activation 2024 (Windows/MacOS)

Webstorm/JetBrains products activation 2024 (Windows/MacOS)

1.Proxy Settings

  1. Step 1: Navigate to Proxy settings.
  2. Step 2: Select "Manual proxy settings - HTTP".
    • Hostname: localhost
    • Port: 80

Set no proxy for:

[
{
"label": "GEOSINTsearch",
"tooltip": "Searches within posts from Twitter, Reddit and 4Chan and presents anything that contains a Google Maps link",
"value": "https://cse.google.com/cse?cx=015328649639895072395:sbv3zyxzmji"
},
{
"label": "Pasted tekst",
"tooltip": "Look if any specifc text has been posted before",
"value": "https://cse.google.com/cse/publicurl?cx=013991603413798772546:nxs552dhq8k"
@JoaoRodrigues
JoaoRodrigues / seq_align.py
Last active May 8, 2024 06:59
Pairwise Sequence Alignment with Biopython
#!/usr/bin/env python
from __future__ import print_function, division
from operator import itemgetter
import os
import sys
import tempfile
import warnings
@gokulkrishh
gokulkrishh / media-query.css
Last active May 8, 2024 06:59
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
impl<V: Value> core::str::FromStr for NonNormalizingDec<V> {
type Err = &'static str;
#[inline(never)]
#[rustfmt::skip]
fn from_str(s: &str) -> Result<Self, Self::Err> {
/// Converts an ASCII decimal digit to an int.
///
/// In release builds, no range checks are performed and passing a
/// non-digit character will result is undefined (yet safe) behavior.